import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import '@wangeditor/editor/dist/css/style.css'
//引入富文本编辑器
import wangeditor from 'wangeditor'
/*引入ElementUI*/
import ElementUI from 'element-ui';
/*引入CSS*/
import 'element-ui/lib/theme-chalk/index.css'
/*Vue加载ElementUI*/
Vue.use(ElementUI)
//将富文本编辑器加载到全局属性 之后直接可以使用
Vue.prototype.wangEditor = wangeditor


//引入Axios框架
import axios from 'axios'
//引入qs
import qs from 'qs'
//将axios加载到vue对象中
Vue.prototype.axios = axios
//将qs加载到vue对象中
Vue.prototype.qs = qs


//导入常量的路径BASE_URL
import BASE_URL from "@/http/baseUrl";
//将加载到Vue对象上
Vue.prototype.BASE_URL=BASE_URL

//重写方法解决跳转到同一路由报错问题
const myReplace = router.replace;
router.replace = function replace(location) {
  return myReplace.call(this,location).catch(err=>err);
};
const myPush = router.push;
router.push = function push(location) {
  return myPush.call(this,location).catch(err=>err);
};



Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
